<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title></title>
</head>
<body>
<f:view>
	<h:form>
		<h:panelGrid columns="2">
		Ad:<h:inputText value="#{schoolBean.mySchool.name}" />
		Ogrenci Sayisi:<h:inputText value="#{schoolBean.mySchool.count}" />
		
		<h:commandButton action="#{schoolBean.addSchool}" value="Ekle" />
		</h:panelGrid>
		<br />
		<h:dataTable value="#{schoolBean.schools}" var="k">
			<h:column>
				<f:facet name="header">
					<h:outputText value="Ad" />
				</f:facet>
				<h:outputText value="#{k.name}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Ogrenci Say." />
				</f:facet>
				<h:outputText value="#{k.count}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="SIL" />
				</f:facet>
				<h:commandLink action="#{schoolBean.removeSchool}" value="SIL">
					<f:setPropertyActionListener value="#{k}" target="#{schoolBean.mySchool}" />
				</h:commandLink>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="DUZENLE" />
				</f:facet>
				<h:commandLink value="DUZENLE">
					<f:setPropertyActionListener value="#{k}" target="#{schoolBean.mySchool}" />
				</h:commandLink>
			</h:column>

		</h:dataTable>

	</h:form>
</f:view>
</body>
</html>
